package GUI.cmd;

import i18n.JButtonI18N;
import i18n.LanguageUtils;

import java.awt.event.ActionEvent;
import java.io.File;

import javax.swing.JFileChooser;
import javax.swing.JOptionPane;

import GUI.GUI;
import GUI.common.ExceptionI18N;
import GUI.common.MissatgePantalla;
import GUI.common.cmd.ClientCommand;
import GUI.forms.FEngines;

public class AddEngine implements ClientCommand {
	final JFileChooser fc = new JFileChooser();

	@Override
	public void execute(GUI gui, ActionEvent source) throws ExceptionI18N {
		// TODO Auto-generated method stub
		JButtonI18N button = (JButtonI18N)source.getSource();
		FEngines form = (FEngines)button.getForm();
		
		int returnVal = fc.showOpenDialog(form);
		
		if (returnVal == JFileChooser.APPROVE_OPTION) {            
            form.addEngine(fc.getSelectedFile());
        }
		
		

	}


}
